{extend name="public:base"/}
{block name="main"}

<form class="layui-form" action="" method="POST">

        <div class="layui-form-item">
          <label class="layui-form-label">管理员名称</label>
          <div class="layui-input-inline" style="width:350px;">
            <input type="hidden" name="adminid" value="{$info['adminid']}">
            <input type="text" name="nickname" required lay-verify="required" placeholder="名称" autocomplete="off" class="layui-input"  value="{$info['nickname']}">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">账号</label>
          <div class="layui-input-inline" style="width:350px;">
            <input type="text" name="username"  placeholder="排序" autocomplete="off" class="layui-input"  value="{$info['username']}">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">密码</label>
          <div class="layui-input-inline" style="width:350px;">
            {notempty name="info['adminid']"}
              <input type="password" name="password"  placeholder="留空不修改密码" autocomplete="off" class="layui-input"  value="">
            {else/}
              <input type="password" name="password"  placeholder="请输入密码" autocomplete="off" class="layui-input"  value="{$info['password']}">
            {/notempty}
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">所属角色</label>
          <div class="layui-input-inline" style="width:350px;">
            <select name="roleid" lay-verify="required" >
              <option value="">请选择角色</option>
                {foreach $rolelist as $v}
                  <option value="{$v['roleid']}" {if condition="$info['roleid'] eq $v['roleid'] "}selected="selected"{/if}>{$v['name']}</option>
                {/foreach}
            </select>     
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">状态</label>
          <div class="layui-input-block">
            <input type="checkbox" name="status" lay-skin="switch" lay-text="启用|禁用" lay-filter="switchTest" value="1" {if condition="($info['status'] eq '1') OR ($info['status'] neq '0')"}checked=''{/if}>
            <div class="layui-unselect layui-form-switch" lay-skin="_switch">
            	<em>OFF</em><i></i>
            </div>
          </div>
        </div>

        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
          </div>
        </div>
</form>
<script type="text/javascript">
  
  layui.use(['form','layedit','upload'], function(){
    var form = layui.form
    ,upload  = layui.upload;
  });
</script>

{/block}